package com.hzhc.controller.pad;

import com.alibaba.fastjson2.JSONObject;
import com.hzhc.entity.Machine;
import com.hzhc.service.MachineService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: LoginController
 * @Description:
 * @version 1.0
 * @author: 功不唐捐
 * @Date: 2024-06-03
 */
@RestController
@RequestMapping("/ipad")
@RequiredArgsConstructor
public class IpadMachineController {

    private final MachineService machineService;

    /**
     * 获取所有机械列表
     * @return
     */
    @PostMapping("/getMachine")
    public Object getMachine() {
        JSONObject jsonObject=new JSONObject();
        Machine machine=new Machine();
        List<Machine> dev =  machineService.getAllMachineList(machine);
        jsonObject.put("code", "200");
        jsonObject.put("data", dev);
        jsonObject.put("totalRow",dev.size());
        jsonObject.put("success", true);
        return jsonObject;
    }
}
